import 'dart:io';

import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart';
import 'package:flutter_displaymode/flutter_displaymode.dart';
import 'package:webview_flutter/webview_flutter.dart';


import 'main.dart';


/// @author: pengboboer
/// @createDate: 2022/1/18
class MainConfig {
  static void init() {
    WidgetsFlutterBinding.ensureInitialized();
    if (Platform.isAndroid) {
      FlutterDisplayMode.setHighRefreshRate();
      WebView.platform = SurfaceAndroidWebView();
    }

    // 强制竖屏
    SystemChrome.setPreferredOrientations(
        [DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);
    SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.light);
  }
}